﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace BFlatCompile.Nodes
{
	public class BracketIndex : Expression
	{
		public Expression Root { get; private set; }
		public Expression Index { get; private set; }
		public Token Token { get; private set; }

		public BracketIndex(Expression root, Expression index, Token token)
		{
			this.Root = root;
			this.Index = index;
			this.Token = token;
		}

		public override void ResolveCode(Class c, Dictionary<object, object> parents)
		{
			this.Root.ResolveCode(c, parents);
			this.Index.ResolveCode(c, parents);
		}

		public override void ResolveClassToThis(Class c)
		{
			this.Root.ResolveClassToThis(c);
			this.Index.ResolveClassToThis(c);
		}
	}
}
